define([], function () {

    var data = [];

    var orderStatusTreeData = [
        {id: "Place", value: "用户已下单"},
        {id: "Expired", value: "已超时关闭"},
        {id: "Paid", value: "用户已支付"},
        {id: "Sent", value: "已发货"},
        {id: "Done", value: "已收货"},
        {id: "UserCanceled", value: "用户已取消"},
        {id: "AdminCanceled", value: "系统已取消"},
        {id: "Done", value: "已收货"}

    ];

    var searchTypeOfUser = [
        {id: "mobile", value: "手机号"},
        {id: "shopName", value: "用户名称"},
        {id: "orderNo", value: "订单号"}
    ];

    function getDistrict(obj) {
        if (!obj) {
            return "无地址"
        }
        return [obj.shippingUserAddressSnapshot.province, obj.shippingUserAddressSnapshot.city, obj.shippingUserAddressSnapshot.district].join("-")
    }

    function getShippingAddress(obj) {
        return [obj.shippingUserAddressSnapshot.province, obj.shippingUserAddressSnapshot.city, obj.shippingUserAddressSnapshot.district, obj.shippingUserAddressSnapshot.address].join("-")
    }

    function getBuyingCountWithColor(obj) {
        if (!obj.count) {
            return "数量异常"
        }
        if (obj.count > 1) {
            return "<span class='multi_buying_count'>" + obj.count + "</span>";
        }
        return obj.count
    }

    function getOrderDisplayStatus(obj) {
        if (obj.data.status == "Place") {
            return "用户已下单"
        }
        if (obj.data.status == "Paid") {
            return "用户已付款"
        }
        if (obj.data.status == "Sent") {
            return "待收货"
        }
        if (obj.data.status == "Done") {
            return "已收货"
        }
        if (obj.data.status == "UserCanceled") {
            return "用户已取消"
        }
        if (obj.data.status == "AdminCanceled") {
            return "系统已取消"
        }
        return "未知状态"
    }



    return {
        getAll: data,
        orderStatusTreeData: orderStatusTreeData,
        getDistrict: getDistrict,
        getShippingAddress: getShippingAddress,
        getBuyingCountWithColor: getBuyingCountWithColor,
        getOrderDisplayStatus: getOrderDisplayStatus,
    };

});